package com.ruoyi.management.statistical.carlocaltion.service.impl;

import com.ruoyi.management.statistical.carlocaltion.mapper.TCarLocationMapper;
import com.ruoyi.management.statistical.carlocaltion.ro.GetDriverByCarNoParam;
import com.ruoyi.management.statistical.carlocaltion.service.ITCarLocationService;
import com.ruoyi.management.statistical.carlocaltion.vo.GetCarLocationVo;
import com.ruoyi.management.statistical.carlocaltion.vo.GetDriverByCarNoVo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * 车辆位置采集信息Service业务层处理
 *
 * @author ruoyi
 * @date 2021-12-01
 */
@Service
public class TCarLocationServiceImpl implements ITCarLocationService {
    @Resource
    private TCarLocationMapper tCarLocationMapper;

    @Override
    @Transactional(rollbackFor = Exception.class)
    public GetCarLocationVo getCarLocation() {
        GetCarLocationVo vo = tCarLocationMapper.getCarLocation();
        return vo;
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public GetDriverByCarNoVo getDriverByCarno(GetDriverByCarNoParam param) {
        return tCarLocationMapper.getDriverByCarno(param);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public int getLastCarCounts() {
        return tCarLocationMapper.selectCarCounts();
    }
}
